import request from '@/utils/request'

// 创建工序节点质检
export function createProcessRouteProcessNodeQuality(data) {
  return request({
    url: '/basic/process-route-node-quality/create',
    method: 'post',
    data: data
  })
}

// 更新工序节点质检
export function updateProcessRouteProcessNodeQuality(data) {
  return request({
    url: '/basic/process-route-node-quality/update',
    method: 'put',
    data: data
  })
}

// 删除工序节点质检
export function deleteProcessRouteProcessNodeQuality(id) {
  return request({
    url: '/basic/process-route-node-quality/delete?id=' + id,
    method: 'delete'
  })
}

/** 批量删除工序节点质检 */
export function deleteProcessRouteProcessNodeQualityList(ids) {
  return request({
    url: `/basic/process-route-node-quality/delete-list?ids=${ids.join(',')}`,
    method: 'delete'
  })
}

// 获得工序节点质检
export function getProcessRouteProcessNodeQuality(id) {
  return request({
    url: '/basic/process-route-node-quality/get?id=' + id,
    method: 'get'
  })
}

// 获得工序节点质检分页
export function getProcessRouteProcessNodeQualityPage(params) {
  return request({
    url: '/basic/process-route-node-quality/page',
    method: 'get',
    params
  })
}
// 导出工序节点质检 Excel
export function exportProcessRouteProcessNodeQualityExcel(params) {
  return request({
    url: '/basic/process-route-node-quality/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}

// 根据工序节点ID获取工序节点质检方案
export function getQualityAllByNodeId(params) {
  return request({
    url: '/basic/process-route-node-quality/getQualityAllByNodeId',
    method: 'get',
    params,
  })
}

// SOP
export function getSOPAllByNodeId(params) {
  return request({
    url: '/basic/process-route-node-sop/getSopAllByNodeId',
    method: 'get',
    params,
  })
}

// 创建SOP
export function createSOP(data) {
  return request({
    url: '/basic/process-route-node-sop/create',
    method: 'post',
    data: data
  })
}
